home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / MacOS 8 Resources / Developer Tools / Mac OS 8 Interfaces & Libraries / Interfaces / PInterfaces / Pointing.p < prev    next >
Text File  |  1996-05-01  |  6KB  |  175 lines

  1. {
  2.      File:        Pointing.p
  3.  
  4.      Contains:    Pointer Family Interface
  5.  
  6.      Version:    Technology:    Copland
  7.                  Release:    Universal Interfaces 3.0d3 on Copland DR1
  8.  
  9.      Copyright:    © 1984-1996 by Apple Computer, Inc.  All rights reserved.
  10.  
  11.      Bugs?:        If you find a problem with this file, send the file and version
  12.                  information (from above) and the problem description to:
  13.  
  14.                      Internet:    apple.bugs@applelink.apple.com
  15.                      AppleLink:    APPLE.BUGS
  16.  
  17. }
  18. {$IFC UNDEFINED UsingIncludes}
  19. {$SETC UsingIncludes := 0}
  20. {$ENDC}
  21.  
  22. {$IFC NOT UsingIncludes}
  23.  UNIT Pointing;
  24.  INTERFACE
  25. {$ENDC}
  26.  
  27. {$IFC UNDEFINED __POINTING__}
  28. {$SETC __POINTING__ := 1}
  29.  
  30. {$I+}
  31. {$SETC PointingIncludes := UsingIncludes}
  32. {$SETC UsingIncludes := 1}
  33.  
  34. {$IFC UNDEFINED __KERNEL__}
  35. {$I Kernel.p}
  36. {$ENDC}
  37. {$IFC UNDEFINED __NAMEREGISTRY__}
  38. {$I NameRegistry.p}
  39. {$ENDC}
  40. {$IFC UNDEFINED __TYPES__}
  41. {$I Types.p}
  42. {$ENDC}
  43.  
  44. {$PUSH}
  45. {$ALIGN MAC68K}
  46. {$LibExport+}
  47.  
  48. {$IFC FOR_SYSTEM8_PREEMPTIVE }
  49. { *************** Constants *************** }
  50.  
  51. CONST
  52.     kAnyDeviceClass                = 'anyp';
  53.     kMouseDeviceClass            = 'mous';
  54.     kTabletDeviceClass            = 'tblt';
  55.     kJoystickDeviceClass        = 'joys';
  56.     kTrackballDeviceClass        = 'trkb';
  57.     kTrackpadDeviceClass        = 'trkp';
  58.     k3DTrackballDeviceClass        = '3dtb';
  59.  
  60.     kMinPTDataSize                = 24;
  61.  
  62.     kPointerFamilyError            = -1;
  63.     kPTUnknownRegEntryRef        = -2;
  64.     kPTInvalidTrackerRef        = -3;
  65.     kPTMemoryAllocationFailed    = -4;
  66.     kPTParamErr                    = -5;
  67.  
  68.  
  69. TYPE
  70.     PTDataRelation                        = UInt16;
  71.  
  72. CONST
  73.     kAbsoluteData                = 1;
  74.     kRelativeData                = 2;
  75.     kAbsoluteOrRelativeData        = 3;
  76.  
  77. { *************** Public Data Structures *************** }
  78. {  old name is TrackerID  }
  79.  
  80. TYPE
  81.     PTTrackerRef = ^LONGINT;
  82.     PTButtonState                        = LONGINT;
  83.     PTButtonStatePtr                    = ^PTButtonState;
  84.     PTPositionPtr = ^PTPosition;
  85.     PTPosition = RECORD
  86.         x:                        LONGINT;
  87.         y:                        LONGINT;
  88.         z:                        LONGINT;
  89.     END;
  90.  
  91. {  old name is PointerData  }
  92.     PTDataPtr = ^PTData;
  93.     PTData = RECORD
  94.         sequencingTag:            AbsoluteTime;
  95.         position:                PTPosition;
  96.         buttons:                PTButtonState;
  97.         uniqueDeviceData:        Ptr;
  98.     END;
  99.  
  100.     PTDeviceModesPtr = ^PTDeviceModes;
  101.     PTDeviceModes = RECORD
  102.         relation:                PTDataRelation;
  103.         uniqueDeviceModes:        Ptr;
  104.     END;
  105.  
  106.     PTDeviceClass                        = OSType;
  107.     PTDeviceIdentifierPtr = ^PTDeviceIdentifier;
  108.     PTDeviceIdentifier = RECORD
  109.         identifier:                PACKED ARRAY [0..254] OF CHAR;
  110.     END;
  111.  
  112.     PTDeviceCapabilitiesPtr = ^PTDeviceCapabilities;
  113.     PTDeviceCapabilities = RECORD
  114.         deviceClass:            PTDeviceClass;
  115.         dataSize:                ByteCount;
  116.         modeDataSize:            ByteCount;
  117.         availableDataRelations:    PTDataRelation;
  118.         defaultDataRelation:    PTDataRelation;
  119.         latency:                LONGINT;
  120.         imitatesMouse:            BOOLEAN;
  121.     END;
  122.  
  123.     PTPinningRectListPtr = ^PTPinningRectList;
  124.     PTPinningRectList = RECORD
  125.         numRects:                INTEGER;                                {  number of rects in list  }
  126.         pinningRect:            RectPtr;                                {  pointer to a list of rects }
  127.                                                                         {  rects must be in global coordinates, in pixels }
  128.     END;
  129.  
  130. { *************** Client Interfaces *************** }
  131. {  *** Getting information about Devices ***  }
  132. FUNCTION PTGetNextDevice(VAR currentDevice: RegEntryRef; filter: PTDeviceClass; VAR nextDevice: RegEntryRefPtr): OSStatus; C;
  133. FUNCTION PTGetDeviceCapabilities(VAR device: RegEntryRef; VAR capabilities: PTDeviceCapabilities): OSStatus; C;
  134. FUNCTION PTGetDeviceIdentification(VAR device: RegEntryRef; VAR identification: PTDeviceIdentifier): OSStatus; C;
  135. {  *** Setting Device Modes ***  }
  136. FUNCTION PTGetDeviceModes(VAR device: RegEntryRef; offset: ByteCount; numBytes: ByteCount; VAR modes: PTDeviceModes): OSStatus; C;
  137. FUNCTION PTSetDeviceModes(VAR device: RegEntryRef; offset: ByteCount; numBytes: ByteCount; VAR modes: PTDeviceModes): OSStatus; C;
  138. {  *** Registering with the Pointing Family ***  }
  139. {
  140.      PTRegisterNewTracker:
  141.     The client provides a reference to device she wants a connection with,
  142.     and whether buffered and/or static data are needed.  A TrackerRef is
  143.     returned, which the client must use in all future communications with 
  144.     the Pointing Family.  In addition, the size of the PTData structure  
  145.     that the given device generates is returned.  
  146. }
  147. FUNCTION PTRegisterNewTracker(VAR device: RegEntryRef; bufferedData: BOOLEAN; stateData: BOOLEAN; VAR tracker: PTTrackerRef; VAR dataSize: ByteCount): OSStatus; C;
  148. {  *** Maintaining Trackers ***  }
  149. FUNCTION PTSetPinningRects(tracker: PTTrackerRef; VAR rectList: PTPinningRectList): OSStatus; C;
  150. {  *** Getting Data ***  }
  151. {  DataSize indicates the size of the buffer allocated by the client for dataPtr.  }
  152. FUNCTION PTGetTrackerData(tracker: PTTrackerRef; dataSize: ByteCount; VAR dataPtr: PTData): OSStatus; C;
  153. FUNCTION PTFlushTrackerBuffer(tracker: PTTrackerRef): OSStatus; C;
  154. {  *** Checking Tracker State ***  }
  155. FUNCTION PTGetPosition(tracker: PTTrackerRef; VAR position: PTPosition): OSStatus; C;
  156. FUNCTION PTSetPosition(tracker: PTTrackerRef; VAR position: PTPosition): OSStatus; C;
  157. FUNCTION PTMovePosition(tracker: PTTrackerRef; VAR position: PTPosition): OSStatus; C;
  158. FUNCTION PTGetButtons(tracker: PTTrackerRef; VAR buttons: PTButtonState): OSStatus; C;
  159. FUNCTION PTSetButtons(tracker: PTTrackerRef; buttons: PTButtonState): OSStatus; C;
  160. FUNCTION PTGetTrackerState(tracker: PTTrackerRef; dataSize: ByteCount; VAR data: PTData): OSStatus; C;
  161. FUNCTION PTSetTrackerState(tracker: PTTrackerRef; dataSize: ByteCount; VAR data: PTData): OSStatus; C;
  162. FUNCTION PTGetTrackerDataByOffset(tracker: PTTrackerRef; offset: ByteCount; numBytes: ByteCount; buffer: UNIV Ptr): OSStatus; C;
  163. FUNCTION PTSetTrackerDataByOffset(tracker: PTTrackerRef; offset: ByteCount; numBytes: ByteCount; buffer: UNIV Ptr): OSStatus; C;
  164. {$ENDC}
  165. {$ALIGN RESET}
  166. {$POP}
  167.  
  168. {$SETC UsingIncludes := PointingIncludes}
  169.  
  170. {$ENDC} {__POINTING__}
  171.  
  172. {$IFC NOT UsingIncludes}
  173.  END.
  174. {$ENDC}
  175.